package com.forum.demo.utils;

import com.forum.demo.common.AppResult;
import com.forum.demo.common.ResultCode;
import com.forum.demo.exception.ApplicationException;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class checkFailUtils {
    public static String checkFail(ResultCode resultCode) {
        log.warn(resultCode.toString());
        throw new ApplicationException(AppResult.failed(resultCode));
    }

    public static String checkFail(String message) {
        log.warn(message);
        throw new ApplicationException(AppResult.failed(message));
    }
}
